package com.enation.app.shop.core.goods.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.enation.app.shop.core.goods.model.Goods;
import com.enation.app.shop.core.goods.plugin.GoodsPluginBundle;
import com.enation.app.shop.core.goods.service.IBrandManager;
import com.enation.app.shop.core.goods.service.IGoodsCatManager;
import com.enation.app.shop.core.goods.service.IGoodsManager;
import com.enation.app.shop.core.goods.service.ITagManager;
import com.enation.app.shop.core.order.service.ICartManager;
import com.enation.app.shop.core.order.service.IOrderManager;
import com.enation.framework.action.GridController;
import com.enation.framework.action.JsonResult;
import com.enation.framework.util.JsonResultUtil;

/**
 * 测试地址:http://localhost:8080/b2c/shop/test/getGoodsById.do?goodsId=10
 * @author Joey
 * @Email 2434387555@qq.com
 *
 */
@Controller
@Scope("prototype")
@RequestMapping("/shop/test")
public class TestController extends GridController {
	@Autowired
	protected IGoodsCatManager goodsCatManager;

	@Autowired
	protected IBrandManager brandManager;

	@Autowired
	protected IGoodsManager goodsManager;

	@Autowired
	private ICartManager cartManager;

	@Autowired
	private IOrderManager orderManager;

	@Autowired
	private GoodsPluginBundle goodsPluginBundle;

	@Autowired
	private ITagManager tagManager;

	@ResponseBody
	@RequestMapping(value = "/getGoodsById")
	public JsonResult getGoodsById(Integer goodsId) {
		Goods goods = goodsManager.getGoods(goodsId);
		return JsonResultUtil.getObjectJson(goods);
	}

}
